﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using simple.Utilities;

namespace simpleHotel.Web.MasterPages
{
    public partial class __Main : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string curlink = Request.RawUrl;

            if (curlink.Contains("/Home.aspx"))
            {
                homeLink.Attributes["class"] = "current";
            }
            else if (curlink.Contains("/CompanyIntroduction.aspx"))
            {
                comIntrLink.Attributes["class"] = "current";
            }
            else if (curlink.Contains("/TourNotebook.aspx"))
            {
                tourLink.Attributes["class"] = "current";
            }
            else if (curlink.Contains("/Promotion.aspx"))
            {
                promotionLink.Attributes["class"] = "current";
            }
            else if (curlink.Contains("/PaymentMethod.aspx"))
            {
                paymentMethod.Attributes["class"] = "current";
            }
            else if (curlink.Contains("/RoomCancellation.aspx"))
            {
                cancellationLink.Attributes["class"] = "current";
            }
            else if (curlink.Contains("/Search.aspx"))
            {
                searchLink.Attributes["class"] = "current";
            }
            else if (curlink.Contains("/Contact.aspx"))
            {
                contactLink.Attributes["class"] = "current";
            }
        }

        protected void btnVietnam_Click(object sender, EventArgs e)
        {
            LanguageManager.CurrentCulture = new CultureInfo("vi-VN");
            Session.Add("CURRENT_LANGUAGE", LanguageManager.CurrentCulture);
            Response.Redirect(Request.Url.AbsoluteUri);
        }

        protected void btnEnglish_Click(object sender, EventArgs e)
        {
            LanguageManager.CurrentCulture = new CultureInfo("en-US");
            Session.Add("CURRENT_LANGUAGE", LanguageManager.CurrentCulture);            
            Response.Redirect(Request.Url.AbsoluteUri);
        }
        
    }
}